Evaluate(T) Method (ConditionValidator(T), Boolean)

CuttingEdge.Conditions

Checks whether the specified condition equals true. An exception is thrown otherwise.

Namespace:  CuttingEdge.Conditions
Assembly:  CuttingEdge.Conditions (in CuttingEdge.Conditions.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function Evaluate(Of T) ( _
	validator As ConditionValidator(Of T), _
	condition As Boolean _
) As ConditionValidator(Of T)
C#
public static ConditionValidator<T> Evaluate<T>(
	ConditionValidator<T> validator,
	bool condition
)
Visual C++
public:
generic<typename T>
static ConditionValidator<T>^ Evaluate(
	ConditionValidator<T>^ validator, 
	bool condition
)
JavaScript
JavaScript does not support generic types or methods.

Parameters

validator
Type: CuttingEdge.Conditions..::.ConditionValidator<(Of <(T>)>)
The ConditionValidator<(Of <(T>)>) that holds the value that has to be checked.
condition
Type: System..::.Boolean
true to prevent an Exception from being thrown; otherwise, false.

Type Parameters

T
The type of the Value of the specified validator.

Return Value

The specified validator instance.

Exceptions

ExceptionCondition
System..::.ArgumentExceptionThrown when the condition equals false, while the specified validator is created using the Requires extension method.
System..::.ArgumentNullExceptionThrown when the condition equals false and the Value of the specified validator is a null reference, while the specified validator is created using the Requires extension method.
System.ComponentModel..::.InvalidEnumArgumentExceptionThrown when the condition equals false and the Value of the specified validator is an Enum type, while the specified validator is created using the Requires extension method.
CuttingEdge.Conditions..::.PostconditionExceptionThrown when the condition equals false, while the specified validator is created using the Ensures extension method.

See Also